<%@ Page Language="C#" MasterPageFile="~/Board.Master" AutoEventWireup="true" CodeBehind="Outbox.aspx.cs" Inherits="UserInterface.PM.Outbox" %>
<%@ Register TagPrefix="pm" TagName="Menu" Src="~/PM/Menu.ascx" %>
<%@ Register TagPrefix="cc" TagName="Pager" Src="~/UserControls/Pager.ascx" %>
<%@ Import Namespace="UserInterface.Misc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" runat="server">
    <pm:Menu ID="Menu" runat="server" />
    
    <div id="private-messages-content">
        <div id="outbox-info">
            <p><asp:Literal ID="OutboxInfo" runat="server" /></p>
        </div>
        
        <cc:Pager ID="TopPager" runat="server" />
        
        <cc:Repeater ID="MessageRepeater" runat="server" OnItemCommand="MessageRepeater_ItemCommand" OnItemDataBound="MessageRepeater_ItemDataBound">
            <HeaderTemplate>
                <div id="private-messages-list">
                    <table>
                        <thead>
                            <tr>
                                <th class="subject"><%= GetLocalResourceObject("Subject") %></th>
                                <th class="to"><%= GetLocalResourceObject("To") %></th>
                                <th class="date-sent"><%= GetLocalResourceObject("DateSent") %></th>
                                <th class="options"><%= GetLocalResourceObject("Options") %></th>
                            </tr>
                        </thead>
                        <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                            <tr>
                                <td class="subject"><a href="Read.aspx?messageId=<%# Eval("Id") %>&amp;ref=outbox"><%# Eval("Subject") %></a></td>
                                <td class="to"><a href="/ViewUser.aspx?userId=<%# Eval("Receiver.Id") %>"><%# Eval("Receiver.Username") %></a></td>
                                <td class="date-sent"><%# OutputTools.FormatDate((DateTime)Eval("DateSent"))%></td>
                                <td class="options">
                                    <asp:Button ID="ReadButton" runat="server" CommandName="Read" CommandArgument='<%# Eval("Id") %>' Text="<%$ Resources: Read %>" />
                                    <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" CommandArgument='<%# Eval("Id") %>' Text="<%$ Resources: Delete %>" />
                                </td>
                            </tr>
            </ItemTemplate>
            <FooterTemplate>
                        </tbody>
                    </table>
                </div>
            </FooterTemplate>
            <EmptyTemplate>
            </EmptyTemplate>
        </cc:Repeater>
        
        <cc:Pager ID="BottomPager" runat="server" />
    </div>
</asp:Content>